package com.smartlifev30.baiwei.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 *
 * @author tys
 * @date 2018/8/15
 */

public class MainFragmentAdapter extends FragmentPagerAdapter{
    private final ArrayList<Fragment> data;

    public MainFragmentAdapter(FragmentManager fragmentManager, ArrayList<Fragment> fragments) {
        super(fragmentManager);
        this.data = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    public ArrayList<Fragment> getData() {
        return data;
    }
}
